package com.leetcode.LC;

public class LC1640 {
    public boolean canFormArray(int[] arr, int[][] pieces) {
        //数组变成字符串，然后检测是否包含
        String s = toStr(arr);
        for (int[] piece : pieces) {
            if (!s.contains(toStr(piece))) {
                return false;
            }
        }
        return true;
    }

    public String toStr(int[] arr) {

        StringBuilder builder = new StringBuilder();
        for (int i : arr) {
            builder.append(i);
            builder.append(',');
        }
        return builder.toString();
    }
}
